package itdfq.dfq.Behavior_Patters.beiwanglu;

import java.util.Stack;

/**
 * @Author GocChin
 * @Date 2021/5/17 21:09
 * @Blog: itdfq.com
 * @QQ: 909256107
 * @Descript:
 */
public class ArticleMementoManager {
    private final Stack<ArticleMemento> ARTICLE_MEMENTO_STACK = new Stack<ArticleMemento>();

    public ArticleMemento getMemento()
    {
        ArticleMemento articleMemento= ARTICLE_MEMENTO_STACK.pop();
        return articleMemento;
    }

    public void addMemento(ArticleMemento articleMemento)
    {
        ARTICLE_MEMENTO_STACK.push(articleMemento);
    }

}
